//
// Created by Tiany on 2021/6/22.
//顺序结构循环队列测试类
#include "SeqQueue.h"
#include "stdio.h"

static void SeqQueueTest(void) {
    struct DataType a[] = {1, 513, 1, 15, 1, 21, 3, 16, 1, 1, 21, 5, 3, 1, 1, 51, 3};
    int length = sizeof(a) / sizeof(a[0]);
    PSeqQueue pSeqQueue;
    pSeqQueue = createEmptyQueue_seq(length * 2);/*创建两倍表长的队列*/
    writeInQueue_seq(pSeqQueue, a, length);/*将数据全部入队*/
    readAllQueue_seq(pSeqQueue);/*读取队列数据并依次打印出来*/

    printf("\n入队\n");
    enQueue_seq(pSeqQueue,a[1]);/*将513入队*/
    readAllQueue_seq(pSeqQueue);

    printf("\n出队\n");
    deQueue_seq(pSeqQueue);/*出队*/
    readAllQueue_seq(pSeqQueue);

    printf("\n取队头元素：%d", frontQueue_seq(pSeqQueue).n);
}
